<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>表单修饰符</title>
</head>

<body>
  <div class="app">
    <input type="number" v-model.number='num'><br>

    <input type="text" v-model.trim='txt'><br>

    <input type="text" v-model.lazy='lazyVal'>
    <p>{{lazyVal}}</p>

    <button @click='handle'> 打印</button>
  </div>
  <script src="./js/vue.js"></script>
  <script>
    var vm = new Vue({
      el: '.app',
      data: {
        num: '',
        txt: '',
        lazyVal: ''
      },
      methods: {
        handle() {
          // console.log(this.num, typeof this.num)
          console.log(this.txt, this.txt.length)
        }
      }
    })
  </script>
</body>

</html>